import Vue from 'vue';
import App from './App';
import VueRouter from 'vue-router';
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import request from 'superagent'
import jsonp from 'superagent-jsonp'
import xData from '../static/data/newData.json'
import VCharts from 'v-charts'
Vue.use(VCharts)
Vue.use(VueRouter);
Vue.use(ElementUI)
// 定义路由组件
const Difficult = require('components/difficult.vue');
const Interest = require('components/interest-page.vue');
const Others = require('components/others.vue')
const Login = require('components/login.vue')
var params = {}
// 定义路由
const routes = [{
		path: '/',
		redirect: '/interest'
	},
	{
		path: '/difficult',
		component: Difficult,
		params:{
			xdata:xData.difficult.course//路由传参，difficult第21行取参，http://blog.csdn.net/wy01272454/article/details/77869442?locationNum=7&fps=1
		}
	},
	{
		path: '/interest',
		component: Interest,
	},
	{
		path: '/others',
		component: Others,
	},
];

// 创建router实例
const router = new VueRouter({
	routes
});

// const store = new Vuex.Store({
//   state: {
//     islogin: false
//   },
//   mutations: {
//     enableLogin(state) {
//       state.islogin = true
//     },
//     disableLogin(state) {
//       state.islogin = false
//     }
//   }
// })

/* eslint-disable no-new */
new Vue({
	el: '#app',
	template: '<App/>',
	components: {
		App
	},
	router,
});
